<?php 
if($edit) {
    $cs=Yii::app()->getClientScript();
    $cs->registerScriptFile(Yii::app()->params->cssBaseUrl.'/jquery.editinplace.js');
    $savingImage=CJavaScript::quote(CHtml::normalizeUrl(Yii::app()->params->sysImageBaseUrl.'/ajax-loader.gif'));

    $setTitleUrl=CJavaScript::quote(CHtml::normalizeUrl(array('setTitle','id'=>$recipe->id)));
    $cs->registerScript('title123', 
        "$('.title123').editInPlace({
            url:'$setTitleUrl', 
            show_buttons:true,
            saving_image: '$savingImage'
        });"
    );

    $setDescriptionUrl=CJavaScript::quote(CHtml::normalizeUrl(array('setDescription','id'=>$recipe->id)));
    $cs->registerScript('description', 
        "$('.description').editInPlace({
            url:'$setDescriptionUrl',
            field_type: 'textarea', 
            textarea_rows: '3',
            textarea_cols: '45',        
            show_buttons:true,
            saving_image: '$savingImage'
        });"
    );
}
?>

<div>
  <div>
  标题
  <div id='title123' class='title123'>
    <?php echo CHtml::encode($recipe->title); ?>
  </div>
  </div>

</div>